<div class="title-menu">
    <h2>Bảng đơn hàng</h2>
</div>
<nav class="bonus">
    
</nav>
<article>
    <table cellspacing="0" cellpadding="5" border="1">
        <tr>
            
            <th>Tên</th>
            <th>Sđt</th>
            <th>Địa chỉ</th>
            <th>Yêu cầu</th>
            <th>Thời gian đặt hàng</th>
            <th>Ngày giao hàng</th>
            <th>Chi tiết</th>
            <th>Tổng tiền</th>
            <th>Trạng thái</th>
            <th>Tùy chọn</th>
        </tr>
        <?php
        if (isset($orders) && count($orders))
            foreach ($orders as $order) {
                ?>
                <tr>
                    
                    <td><?php echo $order->name; ?></td>
                    <td><?php echo $order->phone; ?></td>
                    <td><?php echo $order->address; ?></td>
                    <td><?php echo $order->req; ?></td>
                    <td><?php echo $order->order_time; ?></td>
                    <td><?php echo $order->deli_date; ?></td>
                    <td><a href="<?php echo base_url("backend/orders_detail/view").'/'.$order->id; ?>">Xem</a></td>
                    <td><?php echo number_format($order->total); ?></td>
                    <td><?php if($order->status == 0) echo "Đang xử lý"; else echo "Đã xử lý"; ?></td>
                    <td><a href="<?php echo base_url("backend/orders/update").'/'.$order->id;?>">Sửa</a>                      
                        | <a href="<?php echo base_url("backend/orders/cancel").'/'.$order->id; ?>" onClick="return confirm('Xác nhận hủy?')">Hủy</a>
                    </td>
                </tr>        
                <?php
            }
        ?>
    </table>
    <?php if(isset($paging)) echo $paging;?>
</article>